package com.itheima.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Demo3Stream {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(List.of("林青霞","张曼玉","王祖贤","柳岩","赵敏","张无忌","张三丰","张翠山"));

        Stream<String> limitStream = list.stream().limit(6);

        Stream<String> skipStream = list.stream().skip(5);

        Stream<String> concat = Stream.concat(limitStream, skipStream);
        concat.distinct().forEach(s-> System.out.println(s));


    }
}
